<template>
  <div class="grid skeleton">
    <div class="show-area-item" v-for=" in nums">
      <div class="img ">
      </div>
      <div class="text">
        <div class="one"></div>
        <div class="one"></div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">


withDefaults(defineProps<{
  nums: number
}>(), {
  nums: 5
})
</script>
<style lang="scss" scoped>
%skeleton-bg {
  background: linear-gradient(100deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, .5) 50%,
      rgba(255, 255, 255, 0) 60%);
  background-size: 200% 100%;
  background-position-x: 180%;
  animation: 1s loading ease-in-out infinite;

}

.skeleton {
  // height: 100%;
}

.show-area-item {
  display: flex;
  flex-direction: column;
  width: 7.5rem;
  height: 11rem;
  background-color: var(--background-default-color);
  border-radius: 0.4rem;
  overflow: hidden;
  border: 1px solid var(--background-gray-color);


  .text {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 0.2rem;

    .one {
      width: 100%;
      height: 1rem;
      background-color: var(--background-gray-color);
      margin: 0.1rem 0;
      border-radius: 0.1rem;
      @extend %skeleton-bg;
      animation-delay: .06s;

    }

    .one:nth-child(2) {
      width: 70%;

    }
  }

  .img {
    width: 7.5rem;
    height: 7.5rem;
    background-color: var(--background-gray-color);
    border-radius: 0.4rem;
    @extend %skeleton-bg;
    animation-delay: .03s;


  }

  @keyframes loading {
    to {
      background-position-x: -20%;
    }
  }

}
</style>